
===============================================================================
Notes about Micrelec fiscal signature device functional emulator v2.24B 
===============================================================================



===============================================================================
Package contents
===============================================================================

The package contains the following files:

  * DSEMU224B.EXE        (the emulator executable)
  * TESTPAD.EXE         (a tool for testing the emulator or the actual device)
  * EMULATOR_README.TXT (this file)

===============================================================================
Version history:
===============================================================================

  In version 2.24B:
  * Fixed misplaced FWARN bit (from wrong D4 to correct D5) in app status
    bit.

  In version 2.24:
  * Added filtering of invalid characters in sign streams.
  * Added new error message 0x25 (37 decimal).
  * Added programmable model string.
  * Added variable baud rate to support all micrelec models.
  * Added support for more COM ports.
  * CMOS RESET emulation did not clear daily count; fixed.
  * Changed side logo image.
  
  In version 2.23:
  * Daily Z signature now includes also the last signature (if any).
  * Added 'closure no' field in command 'read signature entry' [$].
  * Added value '2' in command 'xz report' .
  * Added new error message 0x24 (36 dec).
  * Added new event that can generate the error 0x24 in misc dialog.

  In version 2.21:
  * Added 'h' command support.
  * Added 'next z no' field in 'End of signature' and 'Cancel signature' cmds.
  * Added 'remaining daily signatures' field in 'Z' command.
  * Added additional simulated events/settings dialog.
  * Added CMOS bit clearing after Z report.

  In version 2.02a:
  * The RCVR/DAY bits were not cleared after a Z closure; fixed.
  * Added sign base64 block protocol function support.
  * The 'Z report' button did not check for a signature open; fixed.
  * Added base64 content error checks.
  


===============================================================================
Installation
===============================================================================

No installation is required, just make a new directory and copy all files in 
it. Connect the cable and run the 'DSEMU224B.EXE' executable file.



===============================================================================
What is OPSIS250 functional emulator? Why using it?
===============================================================================

  The emulator package is a program that mimics the behavior of a MICRELEC's
digital signature allocating device (and all models using MICRELEC's signature
engine) in all ways possible. It is directed to assist the protocol developer 
in a far better way than the original device. This is achieved by:
   
   * An event/error logging module
     This is a window that receives all events/errors by the emulator. The 
     contents are saved into a file for any use.
   * A three-layer protocol analysis module (transport, function and error)
     This module provides the following services:
     (a) Checks the transport mechanism implementation and responds to any 
         errors with suggestions of what went wrong, what was expected and what
         received instead, timeouts thus assisting greatly the programmer to 
         solve and fix any transport related problems. The developer can also 
         monitor the state transitions and transport details in any state of 
         the protocol.
     (b) A function syntax checking module which will detect any command syntax
         error and report the exact reason that triggered the error. This 
         includes expected ranges, data types, number of parameters etc. Also,
         the syntax checker's hint system provides information with the 
         command's expected syntax in detail.
     (c) An error resolver, which displays the reasons of command failures and
         the way to overcome or handle correctly those failures, all in real
         time.
   * A virtual printer module
     This is a window that mimics the function of the printing device. The
     developer can have the contents of this window saved into a file. 
   * A virtual real time clock module
     This is a virtual 'RTC' that the user can program by protocol commands 
     that gets its initial settings by the PC's system clock and then runs
     independently.
   * A virtual fiscal unit
     This module keeps a virtual fiscal module in a file that contains all 
     fiscal records produced by Z closures. This module can be initialized to
     zero records at anytime, a feature that the actual device cannot provide.
   * A device status monitor and event generator
     This shows the virtual device's hardware related status fields, with the
     ability to override the current states and generating difficult but 
     possible error conditions, such as fiscal failures, CMOS resets, printer
     disconnections etc. Most of those events the developer cannot easily 
     generate on demand using the actual device.
   * An application status monitor
     This shows the virtual device's application related status fields which
     are indicating the behavior of the actual device in response to protocol 
     commands. 
   * A daily signature list viewer
     A window containing all the signatures issued during a 'day'. This helps
     the developer realising the functional cycle of the actual device.
   * A 2-layer logging control system
     This allows the developer to enable or disable all unwanted events caused
     by the protocol analyser. This provides a flexible mechanism of filtering
     unwanted protocol flow information. It acts in both the transport layer 
     and the function layer of the protocol.
   * A manual frame testing tool
     This tool provides an entry box at which the developer can test a specific
     frame's behavior by typing the actual frame data rather than sending by
     the transport services. It is a way to quickly examine the impact of 
     frames in the actual device. The user only passes the non-transport 
     related frame data; the checksum is calculated and appended automatically
     by the tool. 



===============================================================================
What is the TESTPAD utility?
===============================================================================

  The TESTPAD provides a way for the developer to either test the emulator in
action by another program, or test an actual signature device. 


===============================================================================
Cable configuration
===============================================================================

To run the emulator you will need a 'twisted' serial cable with the following
pin assignment:
   RX ----------------------------- TX
   TX ----------------------------- RX
  GND ----------------------------- GND
No other signal connections are required although having them will not cause
any problems. This cable is suitable for either connecting it to the COM1 
port and the COM2 port of the same PC, or to any COM port in one PC to any COM
port to another PC.




===============================================================================
First tests
===============================================================================
To test the emulator in a local (ie a single PC) connection loop, perform the 
following:

1) Connect the cable to COM1 and COM2.
2) Run both the 'DSEMU224B.EXE' and the 'TESTPAD.EXE'.
3) At the emulator, select COM1 port to listen and press 'Start' button.
4) At the testpad, select COM2 and  press the 'Connect' button (make sure that 
   both programs have the same baudrate setting).
5) If all went okay, there is a line in the log window of the testpad that says
   "Device info: [MICRELEC/OPSIS250/02.24]" and the connection is established.
   (If not, probably the cable installation / configuration is incorrect).
6) In the testpad, select a TEXT file and press the 'Sign' button. Observe the
   data traffic in the emulator.

